<template>
    <div class="vp-popover">
        <div class="vp-popover-cont">
            <div class="vp-popover-title">
                <p>投票进度</p>
                <span @click="cancel"></span>
            </div>
            <div class="vp-content">
                <el-table
                    :data="tableData"
                    border
                    size="small"
                    height="500"
                    style="width: 100%"
                    header-row-class-name="table-header">
                    <el-table-column
                        prop="name"
                        label="姓名"
                        align="center">
                    </el-table-column>
                    <el-table-column
                        label="状态"
                        align="center">
                        <template slot-scope="scope">
                            <span style="color: #324890" v-if="scope.row.result == 1">已完成</span>
                            <span style="color: #ED5866"  v-else>未完成</span>
                        </template>
                    </el-table-column>
                    <el-table-column
                        prop="endTime"
                        label="完成时间"
                        align="center">
                    </el-table-column>
                </el-table>
            </div>
        </div>
    </div>
</template>

<script>
import Qs from 'qs'
import { findSchedule } from '@/service/api'
export default {
    name: "voteProgress",
    data() {
        return {
            tableData: []
        }
    },
    props:{
        tableParams:Object
    },
    created() {
        this.inits()
        console.log(this.tableParams)
    },
    methods:{
        inits() {
            let params = this.tableParams;
            findSchedule(Qs.stringify(params)).then(res => {  //筛选查询数据
                if (res.code == 200) {
                    console.log(res)
                    this.tableData = res.data;
                } else {
                    console.log(res)
                }
            });
        },
        cancel() {
            this.$emit('update:showPopover',false)
        },
    }
}
</script>

<style scoped>
.vp-popover {
    position: fixed;
    top: 0px;
    left: 0px;
    z-index: 2;
    height: 100%;
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vp-popover-cont {
    background: white;
    /*width: 35%;*/
    width: 740px;
    min-width: 640px;
    font-size: 14px;
    box-shadow: 3px 1px 12px 1px #00000069;
    border-radius: 10px;
    padding-bottom: 30px;
    position: relative;
}

.vp-popover-title {
    width: 100%;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
    padding: 10px 0px;
    background: url('../../assets/reviews/icon_tu@2x.png') no-repeat;
    background-size: 100% 100%; /* 背景图完整覆盖容器，但宽高比例变了，图片变形。*/
}

.vp-popover-title > span {
    display: block;
    width: 20px;
    height: 20px;
    background: url("../../assets/reviews/icon_shanchu@2x.png") no-repeat;
    background-size: 100% 100%;
    position: absolute;
    right: 30px;
    top: 14px;
    cursor: pointer;
}
.vp-content{
    margin: 13px 25px;
    border-radius: 5px 5px 0px 0px;
    height: 500px;
    overflow: hidden;
}
.vp-content >>> .el-table{

}
.vp-content >>> .table-header th {
    background: #E6EAEB !important;
    border: none;
}
.vp-content >>> .table-header th div{
    font-weight:bold !important;
    color: #333;
}
</style>
